﻿using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.XtraGrid.Views.Grid;

namespace Wolfut.MirageEE.UI.UICommonUtilities
{
    public  class GridOperations
    {
        #region "gridView"
        public static int[] CheckGridViewSelectedCount(GridView view, bool mutiItems)
        {
            if (view.DataRowCount < 1)
            {
                CustomerShowMessage.ShowMessage("I00005");
                return null;
            }
            int[] gridViewHandle = view.GetSelectedRows();

            if (gridViewHandle == null || gridViewHandle.Length <= 0)
                return null;
            if (!mutiItems && gridViewHandle.Length > 1)
            {
                CustomerShowMessage.ShowMessage("I00005");
                return null;
            }
            return gridViewHandle;
        }

        public  static void RefreshGridView(GridView view)
        {
            view.BestFitColumns();
        }
        #endregion
    }
}
